package net.lzzy.chapter20;

import net.lzzy.chapter13.Circle;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class Sort425 {
    public static void main(String[] args ) {
        Circle c1 = new Circle(2);
        Circle c2 = new Circle(5);
        Circle c3 = new Circle(3);

        List<Double> circleList = Arrays.asList(c1.getArea(),c2.getArea(),c3.getArea());
        Collections.sort(circleList, new Comparator<Double>() {
            public int compare(Double o1, Double o2) {
                return (int) (o2 - o1);
            }
        });
        for(Double a :circleList){
            System.out.println(a);
        }

    }
}
